package com.design.behavior.iterator.cainiao;

/**
 * @ProjectName: design
 * @Package: com.design.behavior.iterator.cainiao
 * @ClassName: IteratorPatternDemo
 * @Author: shenaiguo
 * @Description:
 * @Date: 2020/11/15 0015 16:32
 */
public class IteratorPatternDemo {
    public static void main(String[] args) {
        NameRepository namesRepository = new NameRepository();

        for (Iterator iter = namesRepository.getIterator(); iter.hasNext(); ) {
            String name = (String) iter.next();
            System.out.println("Name : " + name);
        }
    }
}
